import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as Icons from '@element-plus/icons'  // 导入所有的icon图标 
import locale from 'element-plus/lib/locale/lang/zh-cn' //导入ElementPlus中文包
import store from './store'  // 导入vuex的store

// 创建一个app 
const app = createApp(App)
app.use(store).use(router).use(ElementPlus, {locale}).mount('#app')

// 遍历所有的icon组件，并添加到全局组件
Object.keys(Icons).forEach((key) =>{
    app.component(key, Icons[key as keyof typeof Icons])
})
